/////////////////////////////////////////////////
repo:    cdriven6x
target:  comment_driven
branch:  6.x-1.x
tags:    6.x-dev
node:    ffaa9f1392b8c167aa29f59d24df1a9a02ac9ab4
changes:
* support [#761288]: notifications_team, reported by Brentnauer
* doc: notifications suite reviewed
/////////////////////////////////////////////////
=================================================
message: support [#761288]: notifications_team, reported by Brentnauer
branch:  6.x-1.x
tags:    
node:    0150dfe43567faca3a6ec8f9eeeea55773bce12b
=================================================
diff -r ffaa9f1392b8 -r 0150dfe43567 comment_driven/comment_driven.module
--- comment_driven.module	Sat Apr 03 18:57:51 2010 -0500
+++ comment_driven.module	Sat Apr 03 20:32:39 2010 -0500
@@ -175,6 +175,13 @@ function comment_driven_is_attachments_o
   return (module_exists('comment_upload') && variable_get('comment_upload_' . $node_type, 0));
 }
 
+// @per-module-discrimination: support notifications_team [#761288]
+function comment_driven_is_notifications_on_thread($node_type) {
+  // not checking for the permission user_access('subscribe other users')
+  // because it is more likely to change between versions or other sub-mods
+  return (module_exists('notifications_team') && notifications_content_type_enabled($node_type, 'thread'));
+}
+
 function comment_driven_allow_empty_comment($node_type) {
   $driver_mod = 'comment_driven';
   $name = 'empty_comment';
@@ -205,6 +212,25 @@ function _comment_driven_disguise_childr
       _comment_driven_disguise_adjust_parents($element[$key]);
       continue; // no need to recursive disguise
     }
+    // support notifications_team [#761288]
+    if ($key === 'notifications' && comment_driven_is_notifications_on_thread($node_type)) {
+      // not checking for the permission user_access('subscribe other users')
+      // because it is more likely to change between versions or other sub-mods
+      // therefore, comment_form might not have 'notifications'
+      //
+      // notifications_team properly reacts to comment submission
+      // moreover it acts on hook_comment insert/update to avoid clashes with other modules
+      // (according to their comments: "in particular, comment_upload")
+      // therefore, it wouldn't mind the comment_form to be disguised
+      // because comment_driven will dispatch it to submission handler already undisguised
+      // BUT, it does need to recognize its sub-elements for theme_notifications_team_form
+      // that's why we can disguise only the parent element and leave the rest beneath it undisguised
+      // @TODO: pending review what other notifications sub-modules might add beneath 'notifications'
+      // which according to _notifications_team_addform seems to be a common practice
+      $element[COMMENT_DRIVEN__DISGUISE_PREFIX . $key] = $element[$key];
+      unset($element[$key]);
+      continue; // don't go in depth
+    }
     // protect ourself against 3rd parties creating NULL children (e.g. [#736968], [#737044])
     // lets babysit NULL children, but it has to be an array otherwise
     if (!is_null($element[$key])) {
=================================================
message: doc: notifications suite reviewed
branch:  6.x-1.x
tags:    tip
node:    9a34ec9a2656b81271845b1ea5e5660b2decd2f9
=================================================
diff -r 0150dfe43567 -r 9a34ec9a2656 comment_driven/comment_driven.module
--- comment_driven.module	Sat Apr 03 20:32:39 2010 -0500
+++ comment_driven.module	Sat Apr 03 21:02:29 2010 -0500
@@ -227,6 +227,11 @@ function _comment_driven_disguise_childr
       // that's why we can disguise only the parent element and leave the rest beneath it undisguised
       // @TODO: pending review what other notifications sub-modules might add beneath 'notifications'
       // which according to _notifications_team_addform seems to be a common practice
+      // I checked every module linked at notifications project page
+      // and the only module adding stuff for comment_from is notifications_ui
+      // notifications_ui_form_alter -> notifications_ui_node_subform -> notifications_ui_options_form 
+      // -> $form['subscriptions'] which is #tree=TRUE and has its own submit button: Update
+      // therefore, I think there shouldn't be any other kind of problem with the notifications suite
       $element[COMMENT_DRIVEN__DISGUISE_PREFIX . $key] = $element[$key];
       unset($element[$key]);
       continue; // don't go in depth
/////////////////////////////////////////////////
generated with: drudiff cdriven6x comment_driven 169 170 171 
/////////////////////////////////////////////////
